#include "my_headerT2csJ.h"

int init_Tcp(char *ip,char *port){
    int sfd = socket(AF_INET,SOCK_STREAM,0);
    int opt = 1;
    setsockopt(sfd,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(opt));
    struct sockaddr_in san;
    bzero(&san,sizeof(san));
    san.sin_family = AF_INET;
    san.sin_port = htons(atoi(port));
    san.sin_addr.s_addr = inet_addr(ip);
    bind(sfd,(struct sockaddr *)&san,sizeof(san));
    listen(sfd,50);
    return sfd;
}
